<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
    <td><a th:href="@{/good/toAddGood}">录入商品</a></td>
    <tr>
        <td>主键id</td>
        <td>商品名称</td>
        <td>价格</td>
        <td>分类</td>
        <td>状态</td>
        <td>操作</td>
    </tr>
    <tr th:each="g:${pageInfo.list}">
        <td th:text="${g.goodid}"></td>
        <td th:text="${g.goodname}"></td>
        <td><span th:text="${g.goodprice}"></span><span th:text="${g.goodunit}"></span></td>
        <td th:text="${g.type.typename}"></td>

        <td th:if="${g.goodstatus}==1">
            烤烟：<input type="radio" name="goodstatus" th:value="上架">
        </td>

        <td th:text="${g.goodstatus}"></td>
        <td>
            <a th:href="@{/good/toUpdateAtatus(goodstatus=${g.goodstatus})}">修改</a>
        </td>
    </tr>
</table>
<p>当前 <span th:text="${pageInfo.pageNum}"></span> 页,总 <span th:text="${pageInfo.pages}"></span> 页,共 <span
        th:text="${pageInfo.total}"></span> 条记录</p>
<a th:href="@{/good/queryGoodList}">首页</a>  <!--在这里如果分页和条件查询要一起实现就必须传条件参数 把参数传到后台-->
<a th:href="@{/good/queryGoodList(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a>
<a th:href="@{/good/queryGoodList(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
<a th:href="@{/good/queryGoodList(pageNum=${pageInfo.pages})}">尾页</a>
</body>
</html>